Skip to content

Conversation

@ethanndickson
Copy link
Member

When editing a message while streaming, pressing Escape to cancel editing would also interrupt the active stream. This is the same issue fixed in PR #954 for workspace renaming.

Added stopPropagation() in both code paths:

  • Non-vim mode: ChatInput's CANCEL_EDIT handler
  • Vim mode: VimTextArea's escapeInNormalMode handler

This prevents the Escape keydown event from reaching the global stream interrupt handler in useAIViewKeybinds.

Generated with mux

When editing a message while streaming, pressing Escape to cancel editing
would also interrupt the active stream. This is the same issue fixed in
PR #954 for workspace renaming.

Added stopPropagation() in both code paths:
- Non-vim mode: ChatInput's CANCEL_EDIT handler
- Vim mode: VimTextArea's escapeInNormalMode handler

This prevents the Escape keydown event from reaching the global stream
interrupt handler in useAIViewKeybinds.

_Generated with `mux`_
@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@ethanndickson ethanndickson added this pull request to the merge queue Dec 9, 2025
Merged via the queue into main with commit c80f3d3 Dec 9, 2025
17 of 19 checks passed
@ethanndickson ethanndickson deleted the escape-stops-stream-editing branch December 9, 2025 06:12
ethanndickson added a commit that referenced this pull request Dec 16, 2025
When recording voice input while streaming, pressing Escape to cancel
recording would also interrupt the active chat stream. This is the same
issue fixed in PR #954 (workspace renaming) and PR #1010 (message editing).

Added `stopPropagation()` to the Escape handler in `useVoiceInput.ts`
to prevent the event from reaching the global stream interrupt handler
in `useAIViewKeybinds`.

Closes #1170

---
_Generated with `mux` • Model: `anthropic:claude-opus-4-5` • Thinking: `high`_
github-merge-queue bot pushed a commit that referenced this pull request Dec 16, 2025
…#1184)

When recording voice input while streaming, pressing Escape to cancel
recording would also interrupt the active chat stream. This is the same
issue fixed in PR #954 (workspace renaming) and PR #1010 (message
editing).

Added `stopPropagation()` to the Escape handler in `useVoiceInput.ts` to
prevent the event from reaching the global stream interrupt handler in
`useAIViewKeybinds`.

I explored ways to unify this pattern (centralized Escape registry,
checking `defaultPrevented`, single global handler with state checks)
but none were better than the simple `stopPropagation()` approach—each
adds coupling or complexity without meaningful benefit. The DOM's event
propagation model is designed for exactly this case.

Closes #1170

---
_Generated with `mux`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant